<?php if (!defined('THINK_PATH')) exit(); /*a:7:{s:87:"E:\web-linux-20180129\linux\checkorder\public/../application/order\view\Dept\index.html";i:1530180661;s:85:"E:\web-linux-20180129\linux\checkorder\public/../application/order\view\pub\head.html";i:1530085432;s:85:"E:\web-linux-20180129\linux\checkorder\public/../application/order\view\pub\left.html";i:1530100909;s:85:"E:\web-linux-20180129\linux\checkorder\public/../application/order\view\dept\add.html";i:1530179651;s:86:"E:\web-linux-20180129\linux\checkorder\public/../application/order\view\dept\edit.html";i:1530180057;s:85:"E:\web-linux-20180129\linux\checkorder\public/../application/order\view\dept\del.html";i:1530180014;s:85:"E:\web-linux-20180129\linux\checkorder\public/../application/order\view\pub\foot.html";i:1530087406;}*/ ?>
<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8" />
	<meta name="viewport" content="width=device-width, initial-scale=1.0">

	<title>操作菜单</title>

	<!-- bootstrap -->
	<link href="__CSS__/bootstrap/bootstrap.css" rel="stylesheet" />

	<!-- libraries -->
	<!-- <link href="css/libs/jquery-ui-1.10.2.custom.css" rel="stylesheet" type="text/css" /> -->
	<link href="__CSS__/libs/font-awesome.css" type="text/css" rel="stylesheet" />

	<!-- global styles -->
	<link rel="stylesheet" type="text/css" href="__CSS__/compiled/layout.css">
	<link rel="stylesheet" type="text/css" href="__CSS__/compiled/elements.css">

	<!-- this page specific styles -->
	<link rel="stylesheet" type="text/css" href="__CSS__/libs/bootstrap-wizard.css">
	<link rel="stylesheet" href="__CSS__/libs/select2.css" type="text/css" />

	<link rel="stylesheet" href="__CSS__/new.css"/>
	<link rel="stylesheet" href="__CSS__/table.css"/>
	<link rel="stylesheet" href="__CSS__/bootstrap-table.css"/>
	<link rel="stylesheet" href="__CSS__/bootstrap-table-fixed-columns.css"/>
	<link rel="stylesheet" href="__CSS__/other.css"/>

	<!-- Favicon -->
	<!--<link type="image/x-icon" href="favicon.png" rel="shortcut icon"/>-->

	<!-- google font libraries -->
	<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,600,700,300|Titillium+Web:200,300,400' rel='stylesheet' type='text/css'>

	<!--[if lt IE 9]>
	<!--<script src="__JS__/html5shiv.js"></script>
	<script src="__JS__/respond.min.js"></script>-->
	<![endif]-->
	<!--[if lt IE 8]>-->
		<!--<link href="__CSS__/libs/font-awesome-ie7.css" type="text/css" rel="stylesheet" />-->
	<script>
	  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
	  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
	  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
	  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

	  ga('create', 'UA-49262924-1', 'phoonio.com');
	  ga('send', 'pageview');

	</script>
	<style>
		.main-box{
			min-height: 820px;
		}
		@media (max-width:1320px){
			.main-box{
				min-height: 600px;
			}
		}

		.fixed-table-body-columns{
			height: 486px!important;
			top: 47px!important;
		}

		.calCancel{
			float: right;
		}
		.forhid{
			display: none;
		}
		#msg{
			background: rgba(255,255,255,0.6);
			border:1px solid #faf2cc;
			text-align:center;
			width: 150px;
			height: 30px;
			margin-left: 50%;
			border-radius: 3px;
		}
	</style>
</head>
<body>
	<!--head-->
	<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

</head>
<body>
<header class="navbar" id="header-navbar">
    <div class="container">
        <a href="index.html" id="logo" class="navbar-brand col-md-3 col-sm-3 col-xs-12">
            <img src="__IMG__/logo.png" class="img" alt=""/>
        </a>

        <button class="navbar-toggle" data-target=".navbar-ex1-collapse" data-toggle="collapse" type="button">
            <span class="sr-only">Toggle navigation</span>
            <span class="fa fa-bars"></span>
        </button>

        <div class="nav-no-collapse pull-right" id="header-nav">
            <ul class="nav navbar-nav pull-right">

                <li class="dropdown profile-dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                        <span class="hidden-xs">welcome</span> <b class="caret"></b>
                    </a>
                    <ul class="dropdown-menu">
                        <li><a href="user-profile.html"><i class="fa fa-user"></i>Profile</a></li>
                        <li><a href="#"><i class="fa fa-cog"></i>Settings</a></li>
                        <li><a href="#"><i class="fa fa-envelope-o"></i>Messages</a></li>
                        <li><a href="#"><i class="fa fa-power-off"></i>Logout</a></li>
                    </ul>
                </li>
                <li class="hidden-xxs">
                    <a class="btn" title="退出登录">
                        <i class="fa fa-power-off"></i>
                    </a>
                </li>
            </ul>
        </div>
    </div>
</header>
</body>
</html>

	<div class="container" role="main">
		<div class="row">
			<div class="col-md-2" id="nav-col">
				<!--left-->
				<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<section id="col-left">
    <div class="collapse navbar-collapse navbar-ex1-collapse" id="sidebar-nav">
        <ul class="nav nav-pills nav-stacked">
            <li class="active">
                <a href="<?php echo url('Index/index'); ?>">
                    <i class="fa fa-dashboard"></i>
                    <span>首页</span>
                </a>
            </li>
            <li>
                <a href="#" class="dropdown-toggle">
                    <i class="fa fa-users"></i>
                    <span>系统管理</span>
                    <i class="fa fa-chevron-circle-down drop-icon"></i>
                </a>
                <ul class="submenu">
                    <li>
                        <a href="<?php echo url('Way/index'); ?>">
                            操作菜单管理
                        </a>
                    </li>
                    <li>
                        <a href="<?php echo url('Role/index'); ?>">
                            角色管理
                        </a>
                    </li>
                    <li>
                        <a href="<?php echo url('Dept/index'); ?>">
                            部门管理
                        </a>
                    </li>
                    <li>
                        <a href="<?php echo url('Admin/index'); ?>">
                            用户管理
                        </a>
                    </li>
                </ul>
            </li>
            <li>
                <a href="#" class="dropdown-toggle">
                    <i class="fa fa-cogs"></i>
                    <span>可配置项管理</span>
                    <i class="fa fa-chevron-circle-down drop-icon"></i>
                </a>
                <ul class="submenu">
                    <li>
                        <a href="<?php echo url('MeterType/index'); ?>">
                            基表型号管理
                        </a>
                    </li>
                    <li>
                        <a href="<?php echo url('ModelType/index'); ?>">
                            电子模块类型管理
                        </a>
                    </li>
                    <li>
                        <a href="<?php echo url('Principle/index'); ?>">
                            生产负责人管理
                        </a>
                    </li>
                    <li>
                        <a href="<?php echo url('Index/index'); ?>">
                            配件管理
                        </a>
                    </li>
                    <li>
                        <a href="<?php echo url('Index/index'); ?>">
                            方案管理
                        </a>
                    </li>
                </ul>
            </li>
            <li>
                <a href="#" class="dropdown-toggle">
                    <i class="fa fa-money"></i>
                    <span>订单管理</span>
                    <i class="fa fa-chevron-circle-down drop-icon"></i>
                </a>
                <ul class="submenu">
                    <li>
                        <a href="<?php echo url('Order/index'); ?>">
                            订单信息
                        </a>
                    </li>
                    <li>
                        <a href="<?php echo url('Index/index'); ?>">
                           统计报表
                        </a>
                    </li>

                </ul>
            </li>

        </ul>
    </div>
</section>
</body>
</html>
			</div>
			<div class="col-md-10" id="content-wrapper">
				<!--<h2 class="pull-left">Last orders</h2>-->
				<div class="row">
					<div class="col-lg-12">
						<!--<div class="row">
							<div class="col-lg-12">-->
								<div class="main-box">
									<!--提示框-->
									<div id="msg">
										<img src="__IMG__/success.png" id="img" alt="" style="float: left;height: 29px;width: 36px;">
										<span id="sp" style="font-size: 14px;line-height: 30px;">提示信息</span>
									</div>
									<div class="clear-fix">
										<button id="open-wizard" class="btn btn-primary">
											<i class="fa fa-plus-circle fa-lg"></i> 添加部门
										</button>

										<div class="filter-block pull-right">
											<form action="<?php echo url('Dept/search'); ?>" method="post">
												<div class="form-group pull-left">
													<input type="text" class="form-control" name="search" placeholder="Search...">
												</div>
												<button class="btn btn-primary pull-right">
													<i class="fa fa-search search-icon"></i> 搜索
												</button>
											</form>

										</div>
									</div>
									<br>
									<div class="table-responsive clearfix">
										<table id="fixedTable" class="table table-striped jambo_table table-hover" data-toggle="table">
											<thead>
												<tr>

													<th><span>部门编号</span></th>
													<th><span>部门名称</span></th>
													<th><span>备注</span></th>
													<th><span>添加日期</span></th>
													<th class="text-center"><span>操作</span></th>
												</tr>
											</thead>
											<tbody>
												<?php if(is_array($depts) || $depts instanceof \think\Collection): $i = 0; $__LIST__ = $depts;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?>
												<tr>
													<td><?php echo $v['de_id']; ?></td>
													<td><?php echo $v['dept_name']; ?></td>
													<td><?php echo $v['description']; ?></td>
													<td><?php echo $v['create_time']; ?></td>
													<td>

														<a class="table-link" href="#" onclick=edit("<?php echo $v['de_id']; ?>") title="修改">
															<span class="fa-stack">
																<i class="fa fa-square fa-stack-2x"></i>
																<i class="fa fa-pencil fa-stack-1x fa-inverse"></i>
															</span>
														</a>
														<a class="table-link danger class-del" href="#" onclick=del("<?php echo $v['de_id']; ?>") title="删除">
															<span class="fa-stack">
																<i class="fa fa-square fa-stack-2x"></i>
																<i class="fa fa-trash-o fa-stack-1x fa-inverse"></i>
															</span>
														</a>
													</td>
												</tr>
												<?php endforeach; endif; else: echo "" ;endif; ?>

											</tbody>
										</table>
									</div>
                                    <!--分页-->
                                    <div>
                                        <?php echo $page; ?>
                                    </div>
									<!--添加弹出框-->
									<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        .wizard-steps{
            display: none;
        }
        .wizard-card{
            width:600px!important;
            height: 220px!important;
        }
        .wizard-modal.modal{
            width:600px!important;
            height: 360px!important;
            margin-left: -240px!important;
        }
        .wizard-back{
            display: none!important;
        }
        .wizard-modal-footer{
            text-align: center;
        }

    </style>
</head>
<body>
<!--添加弹出框-->
<div class="wizard" id="wizard-demo">
    <form method="post" id="addForm">
        <h1>添加部门</h1>
        <div class="wizard-card" data-onValidated="setServerName" data-cardname="name">
            <h3 class="text-center"><span>添加部门</span></h3>

            <div class="wizard-input-section">
                <div class="form-group">
                    <label>部门名称 </label><span>*</span>
                    <div>
                        <input type="text" id="dept_name" name="dept_name_add" required="required" class="form-control col-md-7 col-xs-12">
                    </div>
                </div>
            </div>
            <div class="wizard-input-section">
                <div class="form-group">
                    <label for="last-name">备注
                    </label>
                    <div>
                        <input type="text" id="last-name" name="description_add" class="form-control col-md-7 col-xs-12">
                    </div>
                </div>
            </div>

        </div>

    </form>
</div>
<!--添加弹出框-->

</body>
</html>
                                    <!--修改弹出框-->
                                    <!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<!--修改弹出框-->
<div class="wizard" id="wizard-edit">
    <form method="post" id="addForm">
        <h1>修改部门</h1>
        <div class="wizard-card" data-onValidated="setServerName" data-cardname="name">
            <h3 class="text-center"><span>修改部门</span></h3>
            <input type="hidden" name="de_id_edit" value="">
            <div class="wizard-input-section">
                <div class="form-group">
                    <label>部门名称 </label><span>*</span>
                    <div>
                        <input type="text" id="dept_name" value="" name="dept_name" required="required" class="form-control col-md-7 col-xs-12">
                    </div>
                </div>
            </div>
            <div class="wizard-input-section">
                <div class="form-group">
                    <label for="last-name">备注
                    </label>
                    <div>
                        <input type="text" id="last-name" name="description" value="" class="form-control col-md-7 col-xs-12">
                    </div>
                </div>
            </div>

        </div>

    </form>
</div>
<!--修改弹出框-->
</body>
</html>
                                    <!--删除弹出框-->
                                    <!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>删除</title>
    <style>
        .delete{
            display: none;
        }
    </style>
</head>
<body>
<!--删除 弹框-->
<div class="delete">
    <form method="post" action="<?php echo url('Dept/del'); ?>" enctype="multipart/form-data">
        <input hidden type="text" name="de_id" value="">
        <div id="delete">
            <div class="ltitle">温馨提示</div>
            <div class="lcon">
                <img src="__IMG__/jinggao.png" alt="">
                <p>确定删除?</p>
            </div>
            <div class="alert-btn">
                <button type="submit" class="alert-sure" style="margin-left: 30%;">确定</button>
                <span class="alert-cancel">取消</span>
            </div>
        </div>
    </form>
</div>
</body>
</html>

								</div>
							</div>
						</div>
						
					<!--</div>
				</div>-->
			</div>
		</div>
	</div>
	<!--foot-->
	<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<footer id="footer-bar">
    <p id="footer-copyright">
        &copy; 2018 Laison
        <!--<a href="http://www.adbee.sk/" target="_blank">Adbee digital</a>. Powered by SuperheroAdmin.-->
    </p>
</footer>
</body>
</html>

	<!-- global scripts -->
	<script src="__JS__/jquery.js"></script>

	<script src="__JS__/bootstrap.min.js"></script>

	<!-- this page specific scripts -->
	<script src="__JS__/bootstrap-wizard.js"></script>
	<script src="__JS__/select2.min.js"></script>

	<!-- theme scripts -->
	<script src="__JS__/scripts.js"></script>
	<script src="__JS__/bootstrap-table.js"></script>
	<script src="__JS__/bootstrap-table-fixed-columns.js"></script>
	<script>
		/*$('#fixedTable').bootstrapTable('destroy').bootstrapTable({
            fixedColumns: true,//固定列
            fixedNumber:2 //固定前两列
		})*/
        $(function() {

            $('#sel2').select2();

            $.fn.wizard.logging = false;

            var wizard = $("#wizard-demo").wizard({
                showCancel: true
            });

            wizard.el.find(".wizard-ns-select").change(function() {
                wizard.el.find(".wizard-ns-detail").show();
            });

            wizard.el.find(".create-server-service-list").change(function() {
                var noOption = $(this).find("option:selected").length == 0;
                wizard.getCard(this).toggleAlert(null, noOption);
            });

            wizard.cards["name"].on("validated", function(card) {
                var hostname = card.el.find("#new-server-fqdn").val();
            });

            wizard.on("submit", function(wizard) {
                /*var submit = {
                    "hostname": $("#new-server-fqdn").val()
                };*/

                setTimeout(function() {
                    wizard.trigger("success");
                    wizard.hideButtons();
                    wizard._submitting = false;
                    wizard.showSubmitCard("success");
                    wizard.updateProgressBar(0);
                }, 2000);
                add();
                wizard.reset().close();
                //刷新页面
                window.location.reload();
            });
            $(".wizard-group-list").click(function() {
                alert("Disabled for demo.");
            });

            $("#open-wizard").click(function() {
                wizard.show();
                $('.wizard-cancel').text('取消');
                $('.wizard-cancel').addClass('calCancel')
                // $('.wizard-next').addClass('calCancel')
                $('.wizard-next').text('确定');
            });

            /*$('.wizard-cancel').click(function () {
                //刷新页面
                window.location.reload();
            })
            $('.wizard-close').click(function () {
                //刷新页面
                window.location.reload();
            })*/
        });

        $("#msg").addClass('forhid')

        function add() {
            //var dept_name = $("select[name='pid']").val();
            var dept_name = $("input[name='dept_name_add']").val();
            var description = $("input[name='description_add']").val();
            var data = {'dept_name':dept_name,'description':description}
            //console.log(data)
            $.ajax({
                //几个参数需要注意一下
                type: "POST",//方法类型
                dataType: "json",//预期服务器返回的数据类型
                url: "<?php echo url('Dept/save'); ?>",//url
                data: data,
                success: function (result) {
                    var code = result.code
                    var msg = result.msg
                    changeText(msg, code)
                    //console.log('123'+code)
                },
                error:function (result) {
                    var code = 0
                    var msg = '服务器错误';
                    changeText(msg, code)
                    return false;
                }
            });
        }
        function changeText(msg, code) {
            $('#sp').text(msg)
            if(code != 1){
                $('#img').attr('src', '__IMG__/fail.png')
            }
            $("#msg").removeClass('forhid')
            setTimeout("showOrHid()", 3000)
        }
        function showOrHid() {
            //console.log('123')
            $("#msg").addClass('forhid')
        }

        function edit(de_id) {
            $.post("<?php echo url('Dept/one'); ?>",{de_id:de_id},function(data){
                //console.log(data);
                if(data) {
                    $("input[name='de_id_edit']").val(data[0].de_id)
                    $("input[name='dept_name']").val(data[0].dept_name)
                    $("input[name='description']").val(data[0].description)
                }
            },'json');

            var foredit = $("#wizard-edit").wizard({
                showCancel: true
            });
            foredit.show()
            $('.wizard-cancel').text('取消');
            $('.wizard-cancel').addClass('calCancel')
            // $('.wizard-next').addClass('calCancel')
            $('.wizard-next').text('确定');

            foredit.on("submit", function(wizard) {
                setTimeout(function() {
                    wizard.trigger("success");
                    wizard.hideButtons();
                    wizard._submitting = false;
                    wizard.showSubmitCard("success");
                    wizard.updateProgressBar(0);
                }, 3000);
                esave();
                foredit.reset().close();
                //刷新页面
                window.location.reload();
            });
            $('.wizard-cancel').click(function () {
                //刷新页面
                window.location.reload();
            })
            $('.wizard-close').click(function () {
                //刷新页面
                window.location.reload();
            })
        }
        function esave() {
            var de_id = $("input[name='de_id_edit']").val();
            var dept_name = $("input[name='dept_name']").val();
            var description = $("input[name='description']").val();

            var data = {'de_id':de_id,'dept_name':dept_name,'description':description}
            console.log(data)
            $.ajax({
                //几个参数需要注意一下
                type: "POST",//方法类型
                dataType: "json",//预期服务器返回的数据类型
                url: "<?php echo url('Dept/esave'); ?>",//url
                data: data,
                success: function (result) {
                    //console.log(result)
                    var code = result.code
                    var msg = result.msg
                    changeText(msg, code)
                    //console.log('123'+code)
                },
                error:function (result) {
                    var code = 0
                    var msg = '服务器错误';
                    changeText(msg, code)
                    return false;
                }
            });
        }
        function del(de_id) {
            $.post("<?php echo url('Dept/one'); ?>",{de_id:de_id},function(data){
                // console.log(data);
                if(data) {
                    $("input[name='de_id_del']").val(data[0].de_id)
                }
            },'json');

        }

        $(function () {
            $(".alert-close").click(function () {
                $(".delete").css("display","none")
            })
            $(".alert-cancel").click(function () {
                $(".delete").css("display","none")
            })
            $(".class-del").click(function () {
                $(".delete").css("display","block")
            })

        })
	</script>
</body>
</html>